package com.alibaba.csp.sentinel.dashboard.rule.database.provider;

import com.alibaba.csp.sentinel.dashboard.rule.database.base.BaseDatabaseRuleProvider;
import com.alibaba.csp.sentinel.dashboard.rule.database.enums.DatabaseRuleEnums;
import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.DegradeRuleEntity;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 降级规则
 *
 */
@Component("degradeRuleDatabaseProvider")
public class DegradeRuleDatabaseProvider extends BaseDatabaseRuleProvider {

    @Override
    public List<DegradeRuleEntity> getRules(String appName) throws Exception {
        return super.getRules(appName);
    }

    @Override
    protected DatabaseRuleEnums getDataId() {
        return DatabaseRuleEnums.DEGRADE_RULE;
    }

    @Override
    protected Class getRuleClazz() {
        return DegradeRuleEntity.class;
    }
}
